package controllers;

import models.LocationDistanciaTO;
import models.LocationTO;
import business.LocationBusiness;

public class LocationApplication extends Application {

    public static void consultarEndereco(String cep){
    	System.out.println("consultarEndereco/"+cep);
    	LocationTO location = new LocationTO();
    	location = LocationBusiness.consultarEnderecoPorCep(cep);
    	location.code = CODE_OK_STATUS;
    	location.description = DESCRIPTION_OK_STATUS;
    	renderJSON(location);
    }
    
    public static void calcularDistancia(String cep1, String cep2){
    	System.out.println("calcularDistancia/"+ cep1 +","+ cep2);
    	LocationDistanciaTO distancia = new LocationDistanciaTO();
    	distancia = LocationBusiness.calcularDistancia(cep1,cep2);
    	distancia.code = CODE_OK_STATUS;
    	distancia.description = DESCRIPTION_OK_STATUS;
    	renderJSON(distancia);
    }
    
}